#include <Game/Include/InstallPlayerGameEvent.h>


InstallPlayerGameEvent::InstallPlayerGameEvent(const int &id, const int &paddle_pos_x, const int &paddle_pos_y)
    :GameEvent(GameEventType::INSTALL_PLAYER_EVENT)
{
    this->id = id;
    this->pos_x = paddle_pos_x;
    this->pos_y = paddle_pos_y;
}

InstallPlayerGameEvent::InstallPlayerGameEvent(std::istream &s)
    :GameEvent(s)
{
    ISerializable::read(s, this->id);
    ISerializable::read(s, this->pos_x);
    ISerializable::read(s, this->pos_y);
}

InstallPlayerGameEvent::~InstallPlayerGameEvent(void)
{
}

unsigned int InstallPlayerGameEvent::serialize(std::ostream &s)
{
    unsigned int bytes = GameEvent::serialize(s);
    bytes += ISerializable::write(s, this->id);
    bytes += ISerializable::write(s, this->pos_x);
    bytes += ISerializable::write(s, this->pos_y);
    return bytes;
}

int InstallPlayerGameEvent::getPlayerId() const
{
    return this->id;
}

float InstallPlayerGameEvent::getPosX() const
{
    return this->pos_x;
}

float InstallPlayerGameEvent::getPosY() const
{
    return this->pos_y;
}
